import request from '@/request'

// 获取
export function win(params) {
  return request({
    url: '/data',
    method: 'GET',
    params
  })
}
// 删除
export function remove(id) {
  return request({
    url: `/data/${id}`,
    method: 'DELETE'
  })
}
// 新增
export function Added(data) {
  return request({
    url: '/data',
    method: 'POST',
    data
  })
}
// 编辑
export function editor(data) {
  return request({
    url: `/data/${data.id}`,
    method: 'PUT',
    data
  })
}
export function xiangqing(id) {
  return request({
    url: `/data/${id}`,
    method: 'GET'
  })
}
// 搜索
export const searchAPI = function (name) {
  return request({
    url: `/data/?name=${name}`
  })
}